package com.google.code.ptrends.Application.DAL;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.google.code.ptrends.Application.DAL.entities.CategoryEntity;

/**
 * Session Bean implementation class TestJPABean
 */
@Stateless
@LocalBean
public class TestJPABean {

	@PersistenceContext(name = "Application.DAL")
	private EntityManager entitiManager;

	/**
	 * Default constructor.
	 */
	public TestJPABean() {
		// TODO Auto-generated constructor stub
	}

	public void saveCategory(String name) {
		CategoryEntity categoryEntity = new CategoryEntity();
		categoryEntity.setName(name);
		entitiManager.persist(categoryEntity);
	}

}
